import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import AvgView from '@/views/AvgView.vue'
import HotVideoRank from '@/views/HotVideoRank.vue'
import MonthlyView from '@/views/MonthlyView.vue'
import HotTag from '@/views/HotTag.vue'
import UpView from '@/views/UpView.vue'
import WeeklyView from '@/views/WeeklyView.vue'
import TimeAnalysis from '@/views/TimeAnalysis.vue'
const routes = [
  // 添加根路径重定向
  { path: '/', redirect: { name: 'Home' } },
  { path: '/home', name: 'Home', component: Home },
  { path: '/avgView', name: 'AvgView', component: AvgView },
  { path: '/hotVideoRank', name: 'HotVideoRank', component: HotVideoRank },
  { path: '/monthlyView', name: 'MonthlyView', component: MonthlyView },
  { path: '/weeklyView', name: 'WeeklyView', component: WeeklyView },
  { path: '/hotTag', name: 'HotTag', component: HotTag },
  { path: '/up', name: 'Up', component: UpView },
  { path: '/timeAnalysis', name: 'TimeAnalysis', component: TimeAnalysis },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
})
export default router
